<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html class="no-js">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>沃店</title>
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <!-- No Baidu Siteapp-->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <!-- Add to homescreen for Chrome on Android -->
    <meta name="mobile-web-app-capable" content="yes">

    <!-- Add to homescreen for Safari on iOS -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/amazeui.min
.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/app.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/index.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/jquery-labelauty.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/uploadView.css">
    <!--必要样式-->
    <style type="text/css">
        body {
            background-color: #fff;
        }

        .order {
            margin-top: 20px;
        }

        .idphoto {
            overflow: auto;
            border: 1px solid #ccc;
            border-radius: 5px;
            height: 130px;
            width: 100%;
        }

        .js_showBox {

        }

        .js_uploadBox {
            margin-top: 10px;
        }

    </style>
</head>

<body>
<header data-am-widget="header" class="am-header am-header-default am-header-fixed">
    <div class="am-header-left am-header-nav">
        <a href="${pageContext.request.contextPath}/clientHallOrder/selectPackage?id=${packageId}" class="">
            <i class="am-header-icon am-icon-chevron-left"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">
            填写订单
        </a>
    </h1>
    <div class="am-header-right am-header-nav">
        <a href="${pageContext.request.contextPath}/clientHome/index" class="">
            <i class="am-header-icon am-icon-home"></i>
        </a>
    </div>
</header>
<div class="am-g">
    <div class="clearpadding am-u-sm-12">
        <img src="${pageContext.request.contextPath}/images/broadband.png" style="width: 100%;">
    </div>
</div>
<form class="am-form" method="post" enctype="multipart/form-data"
      action="${pageContext.request.contextPath}/clientHallOrder/addDecoration">
    <fieldset>
        <div class="am-form-group">
            <label class="font_orange">姓名</label>
            <input type="text" class="" name="name">
        </div>
        <div class="am-form-group">
            <label class="font_orange">身份证号</label>
            <input type="text" class="" name="card">
        </div>
        <div class="am-form-group">
            <label class="font_orange">上门地址</label>
            <input type="text" class="" name="address" placeholder="XX街XXX门牌号">
        </div>
        <div class="am-form-group">
            <label class="font_orange">联系电话</label>
            <input type="text" class="" name="phone">
        </div>
        <div class="am-form-group" style="overflow: auto;">
            <label class="font_orange">身份证照片</label>
            <div class="am-g idphoto">
                <div class="control-group js_uploadBox">
                    <div class="am-u-sm-6 " id="divi" onclick="deleteInput('i')">
                        <div class="btn-upload">
                            <a href="javascript:void(0);"><i class="am-icon-picture-o am-icon-md"
                                                             style="color:rgba(0,0,0,0.4)"></i><span
                                    class="js_uploadText" style="font-size:24px"></span></a>
                            <input id="js_upFile" class="js_upFile" type="file" name="cardImages">
                        </div>
                        <div class="js_showBox"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="am-form-group">
            <label for="doc-ta-1" class="font_orange">备注信息</label>
            <textarea class="" rows="5" id="doc-ta-1" name="desc"></textarea>
        </div>
        <div class="am-g" align="center" onclick="sub()">
            <img src="${pageContext.request.contextPath}/images/submit_order.png">
        </div>
    </fieldset>
</form>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/amazeui.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery-labelauty.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.uploadView.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.uploadView.add.js"></script>
<script src="${pageContext.request.contextPath}/layer/layer.js"></script>
<script type="text/javascript">

    var isSubmit = 0;
    function sub() {
        if ($("input[name='name']").val() == "") {
            layer.msg('请填写姓名');
            return;
        }
        if ($("input[name='card']").val() == "") {
            layer.msg('请填写身份证号');
            return;
        }
        if ($("input[name='address']").val() == "") {
            layer.msg('请填写上门地址');
            return;
        }
        if ($("input[name='phone']").val() == "") {
            layer.msg('请填写联系电话');
            return;
        }
        if ($("input[name='cardImages']").length != 2 || $("input[name='cardImages']").eq(1).val() == "") {
            layer.msg('请上传身份证正反面');
            return;
        }

        if (isSubmit == 0) {
            $(".am-form").submit();
            isSubmit = 1;
        } else {
            layer.msg('您已经提交订单了！');
        }

    }
</script>
</body>

</html>
